fix(pascal): detect unqualified paren-less calls (DoWork;) - #1641
Open
equipados wants to merge 1 commit into
Open
fix(pascal): detect unqualified paren-less calls (DoWork;)#1641equipados wants to merge 1 commit into
DoWork;)#1641equipados wants to merge 1 commit into
Conversation
A statement that is nothing but an identifier is an unqualified call to a parameterless routine. Pascal allows dropping the parens on a no-arg call and Delphi codebases do so by convention, so `visitPascalBlock` was missing the majority of intra-unit calls: only `DoWork()` was recorded, never `DoWork;`. The qualified form (`Obj.Free;`) is already handled by `extractPascalParenlessCall`; this is the same idea one step less qualified. Gated on the identifier BEING the whole statement (`node.type === 'statement' && node.namedChildCount === 1`). Anywhere else — assignment RHS, condition, any expression — a bare identifier is indistinguishable from a variable read without type information, so those are left alone. Covered by a negative test.
Author
|
Thanks for putting it through a full integration build — the forced
re-index on
codegraph's own repo is exactly the check I wanted to see, since the risk
here was
changing edges where the parser already behaved.
If it looks good to you, could you submit it as an approving review? The PR
still
shows REVIEW_REQUIRED, so it can't be merged on the comment alone.
Happy to rebase on current main if that helps.
Guillermo Álvarez Leal
*https://equipados.es* <https://equipados.es>
38611 Granadilla de Abona
Tlf:: 655 778 795
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario. En caso de su divulgación, copia o distribución a terceros
sin la previa autorización escrita de Equipados, usted podría estar
vulnerando la legislación vigente. En el caso de haber recibido este correo
electrónico por error, se ruega que nos notifique inmediatamente esta
circunstancia mediante reenvío a la dirección electrónica del remitente. De
conformidad con lo establecido en la LOPD Equipados garantiza la adopción
de las medidas necesarias para asegurar el tratamiento confidencial de los
datos de carácter personal. Así mismo le informamos de inclusión de
sus datos en un fichero con la finalidad de mantener su
relación contractual con Equipados. y de la posibilidad de ejercer los
derechos de acceso, rectificación, cancelación y oposición en la
siguiente dirección: Apartado de correos, nº 190, C.P 38611 – Granadilla
de Abona - Santa Cruz de Tenerife.
El vie, 4 sept 2026 a las 9:17, Daniil ***@***.***>)
escribió:
… *danusha2345* left a comment (colbymchenry/codegraph#1641)
<#1641 (comment)>
Took this into a local integration build (current main + the open fixes I
could merge cleanly) and ran the full suite with the native kernel: 245
files, 4323 passed, 0 failed. No regression on the codegraph repo's own
index after a forced re-index. Looks good to me.
—
Reply to this email directly, view it on GitHub
<#1641?email_source=notifications&email_token=ALJEAIYRD6GAXF4DYU5BHOD5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5537712038>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALJEAI4GZHHZHX4APQBQDXL5NJ3ABAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMZXGA3TQMRVGU5US43TOVSTWNJSG43TANBSGA2DLILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ALJEAIYIO6J54GD35GCWRC35NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/ALJEAI5WSJIXZVOQCUWAS3D5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
[ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage",
"potentialAction": { ***@***.***": "ViewAction", "target": "
#1641?email_source=notifications\u0026email_token=ALJEAI75TPFALJ6SVWUR7VL5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KWZ3NMFUWYX3DNRUWG2Y#issuecomment-5537712038",
"url": "
#1641?email_source=notifications\u0026email_token=ALJEAI75TPFALJ6SVWUR7VL5NJ3ABA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNJTG43TCMRQGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KWZ3NMFUWYX3DNRUWG2Y#issuecomment-5537712038",
"name": "View Pull Request" }, "description": "View this Pull Request on
GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "
https://github.com" } } ]
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A Pascal statement that is nothing but an identifier —
DoWork;— is anunqualified call to a parameterless routine.
visitPascalBlockdidn't treat itas one, so only the parenthesised form
DoWork()produced acallsedge.Pascal lets a no-arg routine drop its parens, and in Delphi that is the
convention rather than the exception, so on a real Delphi codebase most
intra-unit calls were invisible to
callers/callees/impact. Those toolsdidn't return a wrong answer — they returned an empty one, which is harder to
notice.
The qualified form (
Obj.Free;) is already handled byextractPascalParenlessCall(thanks — that landed in 1.5). This is the sameidea one step less qualified.
Measured on a real Delphi codebase
285
.pas/.dprfiles from a production Delphi 10.2 ERP (~1.1M LOC):callsedgesHow it's scoped
Gated on the identifier being the whole statement:
Anywhere else — assignment RHS,
ifcondition, any expression — a bareidentifier is indistinguishable from a variable read without type information,
so those are deliberately left alone. That is what the second test locks in:
isCalled('TFoo::Total')must stayfalse.Tests
Two added next to the existing paren-less test in
__tests__/resolution.test.ts:extracts UNQUALIFIED paren-less calls (Reset;, the dominant Delphi idiom)— fails without the change, passes with it.does not turn a bare identifier that is NOT a whole statement into a call— the negative case above.resolution.test.ts+extraction.test.ts: 788 passed. The 5 failures on mymachine (3× PHP include, 1× C/C++ include, 1× gitlink) are identical before and
after the change — pre-existing and unrelated, likely Windows-specific.
tsc --noEmitclean.Notes
Only
src/extraction/tree-sitter.tschanges; Pascal is not part of the Rustkernel so there is no parity fixture to update.